apiVersion: apps/v1
kind: Deployment
metadata:
  name: backstage
spec:
  replicas: 1
  selector:
    matchLabels:
      app: backstage
  template:
    metadata:
      labels:
        app: backstage
    spec:
      serviceAccountName: backstage-service-account
      containers:
        - name: backstage
          image: backstage
          command:
            - /bin/sh
          args:
            - '-c'
            - "APP_CONFIG_app_baseUrl=$$UFFIZZI_URL APP_CONFIG_backend_baseUrl=$$UFFIZZI_URL APP_CONFIG_auth_environment='production' node packages/backend --config app-config.yaml"
          imagePullPolicy: IfNotPresent
          ports:
            - name: http
              containerPort: 7007
          envFrom:
            - secretRef:
                name: postgres-secrets
          env:
            - name: POSTGRES_PORT
              value: '5432'
            - name: POSTGRES_HOST
              value: 'postgres.default.svc.cluster.local'
            - name: NODE_ENV
              value: production
          resources:
            limits:
              cpu: 1000m
              memory: 384Mi
            requests:
              cpu: 20m
              memory: 160Mi
